package p270jp.pxv.android.viewholder;

import android.view.ViewGroup;
import p210hh.PixivAccountManager;
import p270jp.pxv.android.legacy.constant.PixivisionCategory;
import p325m0.MutabilityOwnership;
import p521th.FlexibleItemAdapterSolidItem;
import p521th.SolidItemViewHolder;
import p671zc.CompositeDisposable;
import p677zi.PixivImageLoader;

/* compiled from: HomePixivisionListSolidItem.kt */
/* renamed from: jp.pxv.android.viewholder.HomePixivisionListSolidItem */
/* loaded from: classes2.dex */
public final class HomePixivisionListSolidItem extends FlexibleItemAdapterSolidItem {
    public static final int $stable = 8;
    private final CompositeDisposable compositeDisposable = new CompositeDisposable();
    private final int numberOfBaseRowsBeforeDisplaying;
    private final PixivImageLoader pixivImageLoader;
    private final PixivisionCategory pixivisionCategory;

    public HomePixivisionListSolidItem(PixivisionCategory pixivisionCategory, int i, PixivImageLoader aVar) {
        MutabilityOwnership.m3745m(pixivisionCategory, "pixivisionCategory");
        MutabilityOwnership.m3745m(aVar, "pixivImageLoader");
        this.pixivisionCategory = pixivisionCategory;
        this.numberOfBaseRowsBeforeDisplaying = i;
        this.pixivImageLoader = aVar;
    }

    @Override // p521th.FlexibleItemAdapterSolidItem
    public int getSpanSize() {
        return 2;
    }

    @Override // p521th.FlexibleItemAdapterSolidItem
    public SolidItemViewHolder onCreateViewHolder(ViewGroup viewGroup) {
        MutabilityOwnership.m3745m(viewGroup, "parent");
        return HomePixivisionListSolidItemViewHolder.Companion.createViewHolder(viewGroup, this.compositeDisposable, this.pixivisionCategory, this.pixivImageLoader);
    }

    @Override // p521th.FlexibleItemAdapterSolidItem
    public void onDetachedFromRecyclerView() {
        this.compositeDisposable.m80f();
    }

    @Override // p521th.FlexibleItemAdapterSolidItem
    public boolean shouldBeInserted(int i, int i2, int i3, int i4) {
        return i3 == 0 && i4 / 2 == this.numberOfBaseRowsBeforeDisplaying + (PixivAccountManager.m5511e().f16507m ? 1 : 0);
    }
}
